<template>
  <!-- 方案规划导航栏 -->
  <div style="border: 1px solid #6979ebba;border-radius: 8px;margin-top: 2.5%;width: 99%;height: 82vh;float: left;position: absolute;">
    <!-- 顶部tab切换 -->
    <div style="margin-left: 1vh;margin-right: 1vh;top: 1%; width: 99%;height: 8vh;float: left;position: absolute;">

      <div id="ieDiv1" @click="buttonClick('loadSimulation', 'ieDiv1')" style="background:#409EFF" class="buttonStyle">建模仿真</div>
      <div id="ieDiv2" @click="buttonClick('planProgram', 'ieDiv2')" class="buttonStyle">方案规划</div>
      <div id="ieDiv3" @click="buttonClick('dispatch', 'ieDiv3')" class="buttonStyle">调度优化</div> 
 
    </div>

    <div style="margin: 9vh auto;width: 98%;height: 71vh;border: 1px solid rgba(105, 121, 235, 0.73);border-radius: 8px;">
      <!--路由页面-->
      <router-view :key="activeDate"></router-view>
    </div>
     

  </div>
</template>

<script>
  export default {
    name: 'integratedEnergyPlanDesign',
    data() {
      return {
        windowDatate: '',
        activeDate: '',
        type: '',
        projectId : '',
      }
    },
    mounted: function() {
      //获取项目id
      this.projectId = this.$route.query.projectId;
      this.activeDate = new Date().getTime();

      this.$router.push('/loadSimulation',{query:{"projectId":this.projectId}});
    },
    methods: {
      buttonClick : function(type,divId){
        for(var i = 1;i<=6;i++){
          $("#ieDiv"+i).css("background","#1f2c6c3b");
        }
        $("#"+divId).css("background","#409EFF");
        this.activeDate = new Date().getTime();
        //路由跳转
        this.$router.push('/'+type,{query:{"projectId":this.projectId}});
      }, 
    }
  }
</script>

<style scoped>
  .buttonStyle {
    height: 4vh;
    width: 24vh;
    display: inline-block;
    -webkit-border-radius: 60px;
    -moz-border-radius: 60px;
    cursor: pointer;
    border-radius: 10px;
    font-family: Arial;
    border: none;
    color: #ffffff;
    font-size: 1.6vh;
    background: #1f2c6c3b;
    border-bottom: 1px solid rgb(64, 158, 255);
    margin: 1.5vh 10px;
    text-align: center;
    line-height: 4vh;
    vertical-align: middle;
    text-decoration: none;
  }
</style>
